package domain;

import util.Calculator;
import physical.CardReader;

import java.text.DecimalFormat;

public class Deposit extends Transaction{

    private String result;

    protected Deposit(Account account) {
        super(account);
        this.setTransType("CDP");
    }

    public String getResult() {
        return result;
    }


    @Override
    public void updateAmount(String amount){
        super.setAmount(amount);
        this.result = decimalFormat.format(Calculator.conversion(getCurBalance() + '+' + amount));
        getAccount().getBalance().setBalance(result);
    }

}

